package com.orangelife.mobile.housepurchasing.biz;

import com.curry.android.http.VolleyHttpUtil;
import com.curry.android.util.JSONHelper;
import com.orangelife.mobile.constants.Constant;

import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * Created by HeYuCan on 2016/5/25.
 */
public class HouseDetailHttpBiz {
//    /**房屋详情*/
    private static final String URL_HOUSE_DETAIL= Constant.URL_REALESTATE_HOUSE_DETAIL;

    /**获取房屋详情*/
    public static void requestHouseDetail(String saleID,VolleyHttpUtil.ResponseCallBack callback) {
        HashMap<String, String> map = new HashMap<>();
        map.put("{saleID}", saleID);
        VolleyHttpUtil.getInstance().getWithCallback(URL_HOUSE_DETAIL,map,callback);
    }

    /**房屋详情的json转化为map*/
    public static Map<String,Object> getHouseDetailAsMap(JSONObject response){
        Map<String ,Object> map= (Map<String,Object>)JSONHelper.jsonToMap(String.valueOf(response)).get("entity");
        return map;
    }
}
